package com.yzz.hzraisedust.hzraseidust.modelbean;

import com.yzz.hzraisedust.hzraseidust.util.AirQualityUtil;

/**
 * Created by zhengzhen on 2017/8/26.
 */

public class PmItemBean {
    private float Noise;
    private int Pm10;
    private int noiseBakcgroudColor;
    public int getNoiseBakcgroudColor() {
        return noiseBakcgroudColor;
    }
    public float getNoise() {
        return Noise;
    }

    public void setNoise(float noise) {
        Noise = noise;
    }

    public int getPm10() {
        return Pm10;
    }

    public void setPm10(int pm10) {
        Pm10 = pm10;
    }

    private int  backgroudColor;

    public int getBackgroudColor() {
        return backgroudColor;
    }

    private String pmDescribe;

    public String getPmDescribe() {
        return pmDescribe;
    }
    public  void concute(){
        if(Pm10 > AirQualityUtil.WORSET_AIR){
            backgroudColor = 0xff7d0122;
            pmDescribe = "严重污染:"+Pm10;
        }else if(Pm10 > AirQualityUtil.SERIOURS_AIR){
            backgroudColor = 0xff650199;
            pmDescribe = "重度污染:"+Pm10;
        }else if(Pm10 >AirQualityUtil.WRNING_AIR){
            backgroudColor = 0xffcb0133;
            pmDescribe = "中度污染:"+Pm10;
        }else if(Pm10 > AirQualityUtil.BETTER_AIR){
            backgroudColor = 0xffff9a32;
            pmDescribe = "轻度污染:"+Pm10;
        }else if(Pm10 > AirQualityUtil.BEST_AIR){
            backgroudColor = 0xfffede31;
            pmDescribe = "良:"+Pm10;
        }else if(Pm10 >0){
            backgroudColor = 0xff009965;
            pmDescribe = "优:"+Pm10;
        }else{
            backgroudColor = 0xff000000;
            pmDescribe = "暂无";
        }
        contuteNoise();
    }
    void contuteNoise(){
        if(Noise > AirQualityUtil.NOISE_WOREST){
            //noiseBakcgroudColor = AirQualityUtil.N
        }else if(Noise > AirQualityUtil.NOISE_WORSE){
            noiseBakcgroudColor = AirQualityUtil.NORMAL_COLOR;
        }else{
            noiseBakcgroudColor = AirQualityUtil.GOOD_COLOR;
        }


    }
}
